package checkers3d.logic;

import java.util.*;

/**
 * An interface for board objects that may have their location on the board
 * changed during game.
 *
 * @author      Ruben Acuna
 */
public interface IBoardObjectDynamic extends IBoardObject
{
    /**
    * Returns a series of points that represent the path (location's the piece
    * 'touches') a piece takes through 3D space to get to another position. The
    * points making up the path are relative to the object's current position.
    * Note that this function assumes that relativePosition is a valid move
    * target. The returned list excludes the point on which the object ready
    * exists.
    *
    * @param  relativePosition A Point3D referencing another position (data is
    *                          relative to this objects current position) that
    *                          this object CAN be move.
    * @return
    */
    LinkedList<Point3D> getPath(Point3D relativePosition);

    /**
    * Returns true if this object can occupy a given position. The entire
    * PlayingSurface3D is passed in addition to the current Point3D location of
    * the pieces and the prospective target Point3D location.  
    *
    * @param  target           A reference to the prospective target point on the
    *                          PlayingSurface3D
    * @param  position         A reference to the point on the PlayingSurface3D
    *                          which was clicked.
    * @return        True if the location is one this object may occupy.
    */
    boolean isValidMoveTarget(PlayingSurface3D playingSurface, Point3D position, Point3D target);

    /**
     * See isValidMoveTarget
     * @param playingSurface
     * @param position
     * @param target
     * @return
     */
    boolean isValidWarpTarget(PlayingSurface3D playingSurface, Point3D position, Point3D target);

    /**
     * Returns true if this object can occupy a given position by jumping.  The
     * entire PlayingSurface3D is passed in addition to the current Point3D
     * location of the pieces and the prospective target Point3D location.
     *
     * @param playingSurface    See above
     * @param position          This is the initial position of the piece.
     * @param target            See Above
     * @return
     */
    boolean isValidJumpTarget(PlayingSurface3D playingSurface, Point3D position, Point3D target);

    /**
    * Returns true if a given Player can select this IBoardObjectDynamic.
    *
    * @param  player The player object trying to select the IBoardObjectDynamic.
    * @return
    */
    boolean isSelectableBy(Player player);
}